package com.yyr.callmessage.core.util;

import com.aliyun.dysmsapi20170525.models.AddSmsSignRequest;
import com.aliyun.tea.*;
import com.aliyun.dysmsapi20170525.*;
import com.aliyun.dysmsapi20170525.models.*;
import com.aliyun.teaopenapi.*;
import com.aliyun.teaopenapi.models.*;

/**
 * @Description:
 * @Author：
 * @Date：2021/6/28
 */
public class AlibabaSMSUtil {
    public static final String accessKeyId = "LTAI5tGrTvoowyFb7Xm79wPU";
    public static final String accessKeySecret = "Ltdibr2Q5vPkAPFpKiw4yGhMpooAQZ";

    /**
     * 使用AK&SK初始化账号Client
     * @param accessKeyId
     * @param accessKeySecret
     * @return Client
     * @throws Exception
     */
    public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
        Config config = new Config()
                // 您的AccessKey ID
                .setAccessKeyId(accessKeyId)
                // 您的AccessKey Secret
                .setAccessKeySecret(accessKeySecret);
        // 访问的域名
        config.endpoint = "dysmsapi.aliyuncs.com";
        return new com.aliyun.dysmsapi20170525.Client(config);
    }

    public static void main(String[] args_) throws Exception {
        java.util.List<String> args = java.util.Arrays.asList(args_);
        com.aliyun.dysmsapi20170525.Client client = AlibabaSMSUtil.createClient(accessKeyId, accessKeySecret);
        AddSmsSignRequest addSmsSignRequest = new AddSmsSignRequest()
                .setResourceOwnerAccount("test")
                .setResourceOwnerId(1L)
                .setSignName("test")
                .setRemark("test");
        // 复制代码运行请自行打印 API 的返回值
        client.addSmsSign(addSmsSignRequest);
    }
}

